#include <bits/stdc++.h>

using namespace std;

const int N = 1e5 + 10;
int n , m;
char mp[1005][1005];
int vis[1005][1005];
int vx[4] = {-1,1,0,0};
int vy[4] = {0,0,-1,1};

struct point{
    int x,y;
};

queue <point> que;

int main()
{
    cin >> n >> m;
    for(int i = 1; i<=n; i++){
        for(int j = 1;  j<= m; j++){
            cin >> mp[i][j];
            if(mp[i][j] == 'E'){
                que.push({i,j});
                vis[i][j] = 1;
            }
        }
    }

    while(!que.empty()){
        point p = que.front();
        que.pop();
        // cout<<"point: x:" << p.x <<" y:" << p.y <<" \n";
        for(int i = 0; i < 4; i++){
            int xx = p.x + vx[i];
            int yy = p.y + vy[i];
            // cout << "xx: " << xx << " yy: " << yy <<"\n";
            if(xx >= 1 && xx <= n && yy >= 1 && yy <= m && vis[xx][yy] == 0 && mp[xx][yy] == '.'){
                
                // vis[p.x][p.y] = 1;
                que.push({xx,yy});
                if(i == 0)mp[xx][yy] = 'v';
                else if(i == 1)mp[xx][yy] = '^';
                else if(i == 2) mp[xx][yy] = '>';
                else mp[xx][yy] = '<';
                vis[xx][yy] = 1;

            }

        }
    }

    for(int i = 1; i <= n ;i++){
        for(int j = 1; j <= m; j++)
            cout <<mp[i][j];
            cout <<'\n';
    }




   
   return 0;
}
